package com.knowledgepoint.study.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.knowledgepoint.study.model.entity.KnowledgePointCategoryLevelOne;

import java.util.List;

/**
 * 一级知识点分类 Service 接口
 */
public interface KnowledgePointCategoryLevelOneService extends IService<KnowledgePointCategoryLevelOne> {
    
    /**
     * 获取所有一级分类
     */
    List<KnowledgePointCategoryLevelOne> listAll();
    
    /**
     * 检查分类名称是否已存在
     */
    boolean isNameExist(String name, Integer excludeId);
    
    /**
     * 分页查询
     */
    <P extends IPage<KnowledgePointCategoryLevelOne>> P page(P page, Wrapper<KnowledgePointCategoryLevelOne> queryWrapper);
    
    /**
     * 根据ID获取分类详情
     */
    KnowledgePointCategoryLevelOne getDetailById(Integer id);
    
    /**
     * 新增分类
     */
    boolean add(KnowledgePointCategoryLevelOne category);
    
    /**
     * 更新分类
     */
    boolean update(KnowledgePointCategoryLevelOne category);
    
    /**
     * 删除分类
     */
    boolean removeById(Integer id);
}
